<?php
namespace app\api\controller;

use support\Request;
use Webman\Exception\BusinessException;

class IndexController extends BaseClientController
{
    public function index(Request $request)
    {
        return "hello";
    }

    public function handleError(Request $request)
    {
        throw new BusinessException("测试错误1");
        return view('index/view', ['name' => 'webman']);
    }

    public function view(Request $request)
    {
        return view('index/view', ['name' => 'wangyang']);
    }

    public function json(Request $request)
    {
        return json(['code' => 200, 'msg' => 'ok']);
    }
}
